import { createRouter, createWebHashHistory } from 'vue-router'

import Login from "../components/Login";
import Home from "../components/Home";
import Welcome from "../components/Welcome";
import users from "../components/Menu/users";
import data from "../components/data";

const routes = [
  {
    path: '/',
    name: 'Login',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    redirect: '/welcome',
    component: Home,
    children:[
      {
        path: '/welcome',
        component: Welcome
      },
      {
        path: '/users',
        component: users
      },
      {
        path:'/data',
        component: data
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
